package com.hong.service.Impl;

import com.hong.dao.Impl.OssDaoImpl;
import com.hong.dao.OssDao;
import com.hong.entity.Oss;
import com.hong.service.OssService;

import java.util.List;

public class OssServiceImpl implements OssService {

    OssDao ossDao = new OssDaoImpl();

    @Override
    public List<Oss> selectAll() {
        return ossDao.selectAll();
    }

    @Override
    public Oss ossListName(String bucketName) {
        return ossDao.ossListName(bucketName);
    }

    @Override
    public boolean addOss(Oss oss) {
        int count = -1;
        //新增
        count =  ossDao.addOss(oss);
        return count > 0 ? true : false;
    }

    @Override
    public boolean updatePermission(String bucketName, String permission) {
        int num = ossDao.updatePermission(bucketName,permission);
        if (num>0){
            return true;
        }
        return false;
    }
}
